import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        vuex_isSharePage: 0, // 是否分享打开
        vuex_wxUserId: '', // 客户经理id
        vuex_wxExternalUserid: '', // 外部联系人id
        vuex_chatId: '', // 群聊id
        vuex_entry: '', // 当前页面入口环境 企微中
        vuex_updateManageInfo: false,
        vuex_isConfig: true, // 当前页面是否需要初始化（企业微信的初始化）
        vuex_isShowPage: true, // 是否显示启动页图片
        vuex_fundUnitValueList: [] // 基金产品单位净值
    },
    mutations: {
        setIsSharePage(state, payload) {
            state.vuex_isSharePage = payload;
        },
        setWxUserId(state, payload) {
            if (payload) {
                state.vuex_wxUserId = payload;
            }
        },
        setWxExternalUserid(state, payload) {
            state.vuex_wxExternalUserid = payload;
        },
        setChatId(state, payload) {
            state.vuex_chatId = payload;
        },
        setEntry(state, payload) {
            state.vuex_entry = payload;
        },
        setFundUnitValueList(state, payload) {
            state.vuex_fundUnitValueList = payload;
        },
        updateVuexUpdateManageInfo(state, payload) {
            state.vuex_updateManageInfo = payload;
        },
        updateVuexIsConfig(state, payload) {
            state.vuex_isConfig = payload;
        },
        updateVuexIsShowPage(state, payload) {
            state.vuex_isShowPage = payload;
        }
    },
    actions: {},
    modules: {}
});
